﻿using System;
using System.Collections;

namespace StackTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Stack stack = new Stack();
            stack.Push("堆栈元素一");
            stack.Push("堆栈元素二");
            stack.Push("堆栈元素三");
            stack.Push("堆栈元素四");
            Console.WriteLine("取出元素：");

            while (stack.Count != 0)
            {
                Console.WriteLine(stack.Pop());
            }

        }
    }
}

